/**
 * 存储localStorage
 * @param {String} name 存储名称
 * @param {*}} content 存储的值
 */
export const setLocalStorage = (name, content) => {
  if (!name) return
  if (typeof content !== 'string') {
    content = JSON.stringify(content)
  }
  window.localStorage.setItem(name, content)
}

/**
 * 获取缓存信息getLocalStorage
 * @param {String} name 名称
 * @return {string}
 */
export const getLocalStorage = name => {
  if (!name) return
  return window.localStorage.getItem(name)
}

/**
 * 删除缓存信息
 * @param {string} name 名称
 */
export const removeLocalStorage = name => {
  if (!name) return
  window.localStorage.removeItem(name)
}
